package me.firstapp.repository.bbs;

import java.util.Map;

import me.firstapp.common.utils.Page;
import me.firstapp.module.bbs.Reply;
import me.firstapp.repository.base.EntityRepository;

public interface ReplyRepository extends EntityRepository<Reply> {

	/**
	 * 查询话题回复的数量
	 * 
	 * @param topicId
	 * @return
	 */
	Long findTopicReplyCounts(Long topicId, Long apiClientId);
	
	Long findReplyCountsBySectionId(Long sectionId, Long apiClientId);

	/**
	 * 分页查询回复
	 * 
	 * @param pageNo
	 * @param pageSize
	 * @param topicId
	 * @param fromMemberId
	 * @param toMemberId
	 * @return
	 */
	Page<Reply> findRepliesPage(Integer pageNo, Integer pageSize, Long topicId, Long fromMemberId, Long toMemberId, Long apiClientId);

	Page<Reply> findRepliesPageByParams(Long topicId, Integer pageNo, Integer pageSize, Map<String, Object> searchParams,
			String sortParam, String sortType, Long apiClientId);
	
	Reply findReplyById(Long id, Long apiClientId);

}
